/**
 * 
 */
package com.morningstar.qs.api.basic.common.jdbc;

/**
 * @author rzeng
 * @deprecated this class is deprecated, please use  com.mstar.qs.common.jdbc.DatabaseConnectiveInfo instead.
 */
public class ConnInfo {
	private String dbName;
	private String dbAddress;
	private int dbPort;
	private String userName;
	private String userPwd;
	
	public void setDbName(String dbName) {
		this.dbName = dbName;
	}
	public String getDbName() {
		return dbName;
	}
	public void setDbAddress(String dbAddress) {
		this.dbAddress = dbAddress;
	}
	public String getDbAddress() {
		return dbAddress;
	}
	public void setDbPort(int dbPort) {
		this.dbPort = dbPort;
	}
	public int getDbPort() {
		return dbPort;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}
	public String getUserPwd() {
		return userPwd;
	}
	
	/**
	 * @deprecated
	 * @param dbType
	 * @return
	 */
	public String getConnUrl(DbType dbType){
		String url = "";
		
		switch (dbType) {
		case MSSQL:
			url = "jdbc:sqlserver://" + this.dbAddress + ":" + this.dbPort + ";DatabaseName=" + this.dbName;
			break;
		case MYSQL:
			url = "jdbc:mysql://" + this.dbAddress + ":" + this.dbPort + "/" + this.dbName;
			break;
		default:
			break;
		}
		
		return url;
	}
}
